package cn.itsource.blog.controller;

import cn.itsource.blog.service.IPermissionService;
import cn.itsource.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/permission")
public class PermissionController {
    @Autowired
    private IPermissionService permissionService;
    @PatchMapping("/list")
    public JsonResult list() {
        try{
            return JsonResult.success(permissionService.getAll());
        }catch (Exception e){
            e.printStackTrace();
            return JsonResult.error(e.getMessage());
        }
    }
}
